package com.sky.mapper;

/**
 * @Author: XJH
 * @Description: TODO
 * @Date: 2025/6/3 20:52
 * @Version: 1.0
 */

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author: XJH
 * @Description: TODO
 * @Date: 2025/6/3 20:52
 * @Version: 1.0
 */
@Mapper
public interface CategoryMapper {

    /**
     * 新增种类
     * @param category
     * @return
     */
    @AutoFill(OperationType.INSERT)
    public void insert(Category category);
    //分页查询
    Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);

    /**
     * 删除种类
     * @param id
     * @return
     */
    void deleteById(Long id);

   /**
     * 修改种类
     * @param category
     * @return
     */
   @AutoFill(OperationType.UPDATE)
    void update(Category category);

    /**
     * 通过类型查询种类
     * @param type
     * @return
     */
    List<Category> QueryClassificationByType(Integer type);

    /**
     * 通过id查询种类
     * @param categoryId
     * @return
     */
    Integer count(Long categoryId);
}
